#!/usr/bin/env node

//3.Promise 异步方式打印文件内容

const fs = require('fs/promises')

async function main(){
  const file = process.argv[2] || __filename;
  try{
    const data = await fs.readFile(file,'utf8');
    console.log(data);
  }catch(e){
    console.log(e.message)
  }
}

main();
